package ygw.study.designPatterns.prototype;

/**
 * <p>
 * 步骤 1
 * 创建一个实现了 Cloneable 接口的抽象类。
 * </p>
 * <p>
 * Copyright:2021.All rights reserved.
 * </p>
 * <p>
 * Company:Zsoft
 * </p>
 * <p>
 * CreateDate:2021-10-20 10:25
 * </p>
 *
 * @author YuGongWen
 * @history Mender:YuGongWen；Date:2021-10-20 10:25；
 */
public abstract class Shape implements Cloneable {

    private String id;
    protected String type;

    abstract void draw();

    public String getType(){
        return type;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public Object clone() {
        Object clone = null;
        try {
            clone = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return clone;
    }
}